home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1192 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.4 KB

  1. Subject: Re: load average patches for MiNT 1.10 + patches
  2. Date: Fri, 11 Mar 94 18:49:28 CET
  3. From: Juergen Lock <nox@jelal.north.de>
  4. In-Reply-To: <2d7f745a1e7e81@anuurn.do.open.de>; from "Martin Koehling" at Mar 10, 94 8:25 pm
  5. Message-Id: <9403111749.AA00136@jelal.north.de>
  6.  
  7. Martin Koehling writes:
  8. > Hi Juergen,
  9. moin
  10. > >michael smith writes:
  11. > >>  but I don't believe in that sort
  12. > >> of ceiling regardless of how it's implemented, and someone is _bound_ to harp
  13. > >> on it.)
  14. > >
  15. > > true.  thats also why you should always do timeouts checks like this
  16. > >
  17. > >    unsigned tick = timer counter (like _hz_200) + time to wait;
  18. > >    for (...)
  19. > >        if (timer counter - tick > 0)  break;
  20. > >
  21. > >instead of
  22. > >    ...
  23. > >        if (timer counter > tick)  break;
  24. > >
  25. > >(and any compiler that `optimizes' the difference away should be shot. :)
  26. > I don't quite see the difference between these two checks - they _both_
  27. > will come into trouble if `counter + time to wait' exceeds the value range
  28. > of `unsigned'!
  29.  
  30.  hmpf i shouldn't post from memory... remove the unsigned, i.e. make
  31. it a signed comparison.  better? :)
  32.  
  33. > The only *real* solution I can see is expanding the timer to a `long
  34. > long'...
  35.  
  36.  only if the timeout is longer than 2^31 ticks.
  37. > Martin
  38.  cheers
  39.     Juergen
  40. -- 
  41. J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
  42.                                 ...ohne Gewehr
  43. PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA 
  44.